<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');


class Lib_admin {

    private $password = 'POPELEGANZ';


    function __construct() {
        $this->ci = & get_instance();
        $this->ci->load->library('session');
    }

    function login($password) {
        if ($password == $this->password){
            $this->ci->session->set_userdata('user_is_admin', true);
            return true;
        }

        return false;

    }

    function logout() {
        
        $this->ci->session->unset_userdata('user_is_admin');

        $this->ci->session->sess_destroy();
    }

    function is_logged_in() {
        return $this->ci->session->userdata('user_is_admin');
    }
    
    
    
    
    
    
}
 